function cjqyOpera(id) {
	var gongChengXMID = document.getElementById("gongChengXMID").value;
	var canJianQYID = document.getElementById("canJianQYID").value;
	if (id == "add") {
		cjqyOperaForm.action = "CanJianQY_Insert.jsp?id=" + gongChengXMID;
		cjqyOperaForm.submit();
	} else if (id == "delete") {
		if (canJianQYID) {
			cjqyOperaForm.action = "deleteCanJianQY?ID=" + canJianQYID + "&gongChengXMID=" + gongChengXMID;
			cjqyOperaForm.submit();
		} else {
			alert("请选择要删除的参建企业");
		}
	} else if (id == "update") {
		if (canJianQYID) {
			cjqyOperaForm.action = "viewCanJianQY?ID=" + canJianQYID + "&viewOrUpdate=update";
			cjqyOperaForm.submit();
		} else {
			alert("请选择要修改的参建企业");
		}
	}
}
function selectCanJianQYID(id) {
	var boxes = document.getElementsByName("checkbox");
	for (var i = 0; i < boxes.length; i++) {
		if (boxes[i].id == id) {
			boxes[i].checked=true;
			document.getElementById("canJianQYID").value = id;
		} else {
			boxes[i].checked=false;
		}
	}
	
	
}
function insertCanJianQY() {
	document.getElementById("tanChuFrame").src = "CanJianQY_Insert.jsp";
	document.getElementById("tanChuDiv").style.display = "block";
	document.getElementById("cover").style.display = "block";
}

function updateCanJianQY() {
	document.getElementById("tanChuFrame").src = "listGongCheng?pageSize=3&pageNum=1";
	document.getElementById("tanChuDiv").style.display = "block";
	document.getElementById("cover").style.display = "block";
}

function hidden() {
	document.getElementById("cover").style.display = "none";
	document.getElementById("tanChuDiv").style.display = "none";
}
function setDate() {
	var jiLuSJ = document.getElementById("JILUSJ").value;
	var jiaoHuoRQ = document.getElementById("JIAOHUORQ").value;
	document.getElementById("DS_JiLuSJ").value = jiLuSJ;
	document.getElementById("DS_JiaoHuoRQ").value = jiaoHuoRQ;
}
function selectQY() {
	document.getElementById("tanChuFrame").src="listQiYe?pageSize=3&pageNum=1";
	document.getElementById("tanChuFrame").style.display = "block";
	document.getElementById("tanChuDiv").style.display = "block";
	document.getElementById("cover").style.display = "block";
}

function homePage() {
	var pageSize = document.getElementById("pageSize").value;
	cjqyOperaForm.action="listCanJianQY?pageSize=" + pageSize + "&pageNum=1";
	cjqyOperaForm.submit();
}
function prePage() {
	var pageSize = document.getElementById("pageSize").value;
	var currentPage = document.getElementById("currentPage").value;
	if (currentPage <= 1) {
		currentPage = (1 + 1);
	}
	cjqyOperaForm.action="listCanJianQY?pageSize=" + pageSize + "&pageNum=" + (parseInt(currentPage)-parseInt('1'));
	cjqyOperaForm.submit();
}
function nextPage() {
	var pageSize = document.getElementById("pageSize").value;
	var currentPage = document.getElementById("currentPage").value;
	var totalPage = document.getElementById("totalPage").value;
	if (currentPage >= totalPage ) {
		currentPage = (parseInt(totalPage) - parseInt('1'));
	}
	cjqyOperaForm.action="listCanJianQY?pageSize=" + pageSize + "&pageNum=" + (parseInt(currentPage)+parseInt('1'));
	cjqyOperaForm.submit();
}
function endPage() {
	var pageSize = document.getElementById("pageSize").value;
	var totalPage = document.getElementById("totalPage").value;
	cjqyOperaForm.action="listCanJianQY?pageSize=" + pageSize + "&pageNum=" + totalPage;
	cjqyOperaForm.submit();
	
}